// 统一管理首页数据接口
import request from '@/utils/request'
import type { HospitalResponseData, HospitalLevelAndRegionResponseData, SearchHospitalResponseData } from './type'
// 通过枚举管理接口
enum API {
  HOSPITAL_API = 'hosp/hospital/',
  HOSPITAL_LEVLE_AND_REGION_API = '/cmn/dict/findByDictCode/',
  HOSPITAL_INFO_URL = '/hosp/hospital/findByHosname/'
}

// 获取医院的数据
export const reqHostipal = (page: number, limit: number) =>
  request.get<any, HospitalResponseData>(API.HOSPITAL_API + page + '/' + limit)

// 获取等级或医院地区的数据
export const reqHospitalLevelAndRegion = (dictCode: string) =>
  request.get<any, HospitalLevelAndRegionResponseData>(API.HOSPITAL_LEVLE_AND_REGION_API + dictCode)

// 通过关键字获取医院名称
export const reqHospitalInfo = (hostname: string) => request.get<any,SearchHospitalResponseData>(API.HOSPITAL_INFO_URL + hostname)